Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace Jest with Vitest 2 #4728

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

birkskyum
Copy link
Member

@birkskyum birkskyum commented Sep 20, 2024

This PR replaces the test runner (unit/integration/build) from Jest to Vitest 2, which has built-in support for TS/ESM and the same syntax as Jest. This PR serves to help us evaluate the option, and to move forward faster if there's a decision to proceed at some point.

A key motivation for examining this change is that I've found it quite challenging to move these tickets forward:

Part of the struggle is that Jest only has experimental ESM support, and I've so far not managed to see an effect of the useESM setting in the ts-jest plugin used in this repo.

It's a continuation of

Relates to Rolldown, because vitest is downstream of vite, and thus eventually will swap internals to use rolldown:

Relates to browser runner, because vitest is working on a browser mode:

Launch Checklist

  • Confirm your changes do not include backports from Mapbox projects (unless with compliant license) - if you are not sure about this, please ask!

@codecov-commenter
Copy link

codecov-commenter commented Sep 20, 2024

Codecov Report

Attention: Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.

Project coverage is 71.14%. Comparing base (d3f2bca) to head (28ec0ae).
Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
src/source/tile.ts 0.00% 0 Missing and 1 partial ⚠️
src/util/web_worker_transfer.ts 0.00% 0 Missing and 1 partial ⚠️

❗ There is a different number of reports uploaded between BASE (d3f2bca) and HEAD (28ec0ae). Click for more details.

HEAD has 3 uploads less than BASE
Flag BASE (d3f2bca) HEAD (28ec0ae)
9 6
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #4728       +/-   ##
===========================================
- Coverage   90.48%   71.14%   -19.34%     
===========================================
  Files         265      262        -3     
  Lines       38113    37819      -294     
  Branches     3166     1955     -1211     
===========================================
- Hits        34488    26908     -7580     
- Misses       2650     9638     +6988     
- Partials      975     1273      +298     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@birkskyum birkskyum force-pushed the vitest-2.0 branch 2 times, most recently from 4762bb5 to 9386082 Compare September 20, 2024 14:12
@birkskyum birkskyum changed the title Replace Jest to Vitest 2 Replace Jest with Vitest 2 Sep 21, 2024
@birkskyum birkskyum marked this pull request as ready for review September 21, 2024 21:24
@birkskyum birkskyum force-pushed the vitest-2.0 branch 3 times, most recently from 9f50b69 to 47ea443 Compare October 31, 2024 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants